package com.sky.mapper;

import com.sky.dto.OrdersPageQueryDTO;
import com.sky.entity.Orders;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface AdminOrderMapper {

    /**
     * 分页条件查询
     *
     * @param ordersPageQueryDTO
     * @return {@link List}<{@link Orders}>
     */
    List<Orders> selectPage(OrdersPageQueryDTO ordersPageQueryDTO);

    /**
     * 各个状态的订单数量统计
     *
     * @param status
     * @return {@link Integer}
     */
    @Select("select COUNT(*) from orders group by status having status = #{status}")
    Integer selectByStatus(Integer status);
}
